<template lang="pug">
  div
    h1 Page A 12
    router-link(:to="{name:'PageB'}") Go Page B
    router-link(:to="{name:'Login'}") Login
    h2 myDirName：{{myDirName}}
    h2 staticName：{{staticName}}
    p
      el-button(v-on:click="createFolder") 建目录
      el-button(v-on:click="writeLog") 打印日志
      el-button(v-on:click="operFolder") 打开文件夹
</template>

<script type="text/ecmascript-6">
  import path from 'path'
  import nodeCmd from 'node-cmd'

  export default {
    data() {
      return {
        myDirName: '',
        staticName: ''
      }
    },
    mounted() {
      console.log('/* 2019年3月11日09:02:22 */ Page A')
    },
    methods: {
      createFolder() {
        this.myDirName = path.join(__dirname, 'img', 'logo--assets.png')
        this.staticName = __static
        console.log('__dirname', __dirname)
        console.log('__static', this.staticName)
        console.log('__filename', __filename)
      },
      writeLog() {
      },
      operFolder() {
        let projectFolder = `start ${__static}`
        console.log('projectFolder', projectFolder)
        nodeCmd.get(projectFolder, (err) => {
          if (err) {
            throw err
          }
        })
      }
    }
  }
</script>

<style scoped lang="stylus" rel="stylesheet/stylus">
</style>
